extends Node
@onready var rich_text = $ui/RichText


func _on_write_text_submitted(new_text):
	var p_name = $game.login_recive_data[0]
	_new_text.rpc(new_text, p_name)

@rpc("any_peer" , "call_local")
func _new_text(new_text:String, p_name:String):
	$ui/write.text = ""
	var id = multiplayer.get_remote_sender_id()
	var player = $game/players.get_node(str(id))
	rich_text.append_text("[color=green]%s: [/color]%s \n" %[p_name,new_text])
	player.dis_text(new_text)
